import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;

import	java.util.ArrayList;
import java.util.Arrays;
import	java.util.List;
import java.util.Random;

/**
 * @author jj
 * @date 2019/10/24 9:27
 */

public class MathTest {
    @Test
    public  void math() {
        for (int i=0;i<10;i++) {
            int w = (int) (Math.random() * 2);
            System.out.println(w);
        }
    }
    @Test
    public void math1()throws ArithmeticException {
      //  System.out.println(100/01);
        Random rand = new Random();
        rand.nextInt(1);
        System.out.println();
        String[] sections = "60-80".split("-");
        String section1 = sections[0];
        String section2 = sections[1];
       for (int i = 0; i < 1000; i++) {
         //  int bottom=rand.nextInt((Integer.valueOf(section2)+1-Integer.valueOf(section1)))+Integer.valueOf(section2);
           System.out.println(rand.nextInt(3)+1);
          // System.out.println(100/(rand.nextInt(5)+1));
           //int s=100/rand.nextInt(5)+1;
          /* System.out.println(bottom+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
           System.out.println(s+"::55");*/

        }
    }
    @Test
    public void  math2() {
        Random rand = new Random();

        for (int i = 0; i < 1000; i++) {
            int random=rand.nextInt(3);
            System.out.println(random);

        }

    }
    @Test
    public void  math8() {
        int i=1000/9;
        int j=9*111;
        System.out.println(i+"@@"+j);

    }


    @Test
    public void  math3() {
        List<Integer> list = new ArrayList<> ();
        int a=12434;
        //500
        int residues;
        int residue=0;
        int number =0;
        Integer[] integerArray = {500,100, 50, 20, 10,1};
        List<Integer> list1 = new ArrayList<>(Arrays.asList(integerArray));
        boolean b=true;
        for (Integer mt:list1){
            System.out.println(mt);
            if (a>=mt){
                residue=a%mt;
                if (residue==0){
                    number =a/mt;
                    a=0;
                }else {
                    residues=a-residue;
                    a=residue;
                    number = residues/mt;
                }
                System.out.println(a);
                for (int i=0;i<number ;i++){
                    list.add(mt);
                }
                if (a==0){
                    break;
                }
            }
        }

        System.out.println(list);
      }
    @Test
    public void   math4() {
        String s = math5();
        System.out.println(10000.0<5&&5!=0);
    }
    private String  math5() {
        return "";
    }
}
